package com.gph.saviorframework.wf.service.impl;

import com.gph.saviorframework.wf.dao.ActivitiDefConfigDao;
import com.gph.saviorframework.wf.model.ActivitiDefConfig;
import com.gph.saviorframework.wf.service.ActivitiDefConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public class ActivitiDefConfigServiceImpl implements ActivitiDefConfigService {

    @Autowired
    private ActivitiDefConfigDao dao;

    @Transactional
    @Override
    public void save(ActivitiDefConfig config) {
        dao.save(config);
    }

    @Transactional
    @Override
    public void batchSave(List<ActivitiDefConfig> configs) {
        dao.batchSave(configs);
    }

    @Transactional
    @Override
    public void update(ActivitiDefConfig config) {
        dao.update(config);
    }

    @Transactional(readOnly = true)
    @Override
    public ActivitiDefConfig get(String id) {
        return dao.get(id);
    }

    @Transactional(readOnly = true)
    @Override
    public ActivitiDefConfig getByDefIdAndTaskId(String defId, String taskId) {
        return dao.getByDefIdAndTaskId(defId,taskId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<ActivitiDefConfig> getByDefId(String defId) {
        return dao.getByDefId(defId);
    }

    @Transactional
    @Override
    public void deleteByDefId(String defId) {
        dao.deleteByDefId(defId);
    }

    @Transactional
    @Override
    public void delete(String id) {
        dao.deleteById(id);
    }
}
